package com.dongdongsongcan.app.view;

import android.content.Context;
import android.widget.TextView;

import com.dongdongsongcan.app.R;
import com.dongdongsongcan.app.common.DDConstant;
import com.dongdongsongcan.app.db.bean.ShoppingCarDBBean;
import com.su.dolphin.utils.ViewUtil;

public class OrderInfoFoodItem extends BaseViewItem<ShoppingCarDBBean> {

    private final TextView mOrderinfo_foodname;
    private final TextView mOrderinfo_pkgprice;

    public OrderInfoFoodItem(Context context) {
        mContainer = ViewUtil
                .inflateView(R.layout.layout_orderinfo_fooditem, context);
        mOrderinfo_foodname = (TextView) mContainer
                .findViewById(R.id.orderinfo_foodname);
        mOrderinfo_pkgprice = (TextView) mContainer
                .findViewById(R.id.orderinfo_pkgprice);
    }

    public void setInfo(ShoppingCarDBBean shoppingCarDBBean) {
        if (shoppingCarDBBean == null) {
            return;
        }
        mOrderinfo_foodname.setText(shoppingCarDBBean.getProudctname() + "    x" + shoppingCarDBBean.getCount() + "    " + DDConstant.RMB + shoppingCarDBBean.getPrice());
        mOrderinfo_pkgprice.setText("    x" + shoppingCarDBBean.getCount() + "    " + DDConstant.RMB + shoppingCarDBBean.getPackage_price());
    }

}
